#ifndef __EVENT_H
#define __EVENT_H

#include <types.h>

#define MOUSE_EVENT	\
    void (*onPress)(void *arg); \
    void (*onRelease)(void *arg); \
    void (*onClick)(void *arg); \
    void (*onDoubleClick)(void *arg); \
    void (*onDrag)(void *arg)

/* Event trigger types */
#define EVENT_TRIG_CONTINUOUS  0x00
#define EVENT_TRIG_SINGLE      0x01
//#define EVENT_STATUS_TRIGGERED 0x10

/* Event Flags */
#define FLAG_NONE     0x0
#define FLAG_PRESS    0x1
#define FLAG_RELEASE  0x2
#define FLAG_CLICK    0x4
#define FLAG_DBCLICK  0x8
#define FLAG_DRAG     0x10

/* Event structure */
typedef struct {
	int flag;
	COORD pos;
	unsigned long timestamp;
} EVENT;

void event_arbitrator(void);
inline void event_available(u8);

#endif
